package calbs.socket.packaging;

import calbs.socket.pojo.resp.RespBaseMsg;
import calbs.socket.pojo.resp.RespData;
import calbs.socket.pojo.resp.RespUploadAbLineMsg;
import calbs.socket.tool.CHexConver;

/**
 * Created by Q on 2017/8/10.
 */
public class UploadLinePackingImp implements PackagingI<RespUploadAbLineMsg> {
    @Override
    public String analysisMsg(RespData<RespUploadAbLineMsg> respData) {
        RespUploadAbLineMsg respUploadAbLineMsg = respData.getBody();
        int abLineID = respUploadAbLineMsg.getAdLineID();
        String content = CHexConver.integeroHexString(abLineID,4);
        String fieldName = respUploadAbLineMsg.getFieldName();
        content = content+CHexConver.packagingStr(fieldName);
        return PackingUtils.packing(respData.getBody(),content);
    }
}
